package cn.com.jinhao.provider.business.service.impl;

import cn.com.jinhao.provider.business.entity.Visit;
import cn.com.jinhao.provider.business.mapper.VisitMapper;
import cn.com.jinhao.provider.business.service.VisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * hotline-spring-cloud
 * <p>Description: </p>
 *
 * @author hxp
 * @version 1.0
 * @date 2020/2/21
 * @since 2020-02-21
 */
@Service
public class VisitServiceImpl extends CommonService implements VisitService {

    private VisitMapper visitMapper;
    @Autowired
    public VisitServiceImpl(VisitMapper visitMapper){
        this.visitMapper = visitMapper;
    }

    @Override
    public List<Visit> historyVisit(String eventCode) {
        try {
            Visit visit = new Visit();
            visit.setStdeptCode(eventCode);
            return visitMapper.select(visit);
        } catch (Exception e) {
            throw new IllegalStateException("查询回访失败", e);
        }
    }
}
